#include "VBrowser.h"
#include <QEvent>

VBrowser::VBrowser(QWidget*parent)
	: QWidget(parent)
{
	webView = wkeCreateWebWindow(WKE_WINDOW_TYPE_CONTROL, (HWND)this->winId(), 0, 0, this->width(), this->height());
	wkeShowWindow(webView, TRUE);
	wkeLoadURL(webView, "https://www.51yishen.com/");
	this->installEventFilter(this);
}

VBrowser::~VBrowser()
{
}

bool VBrowser::eventFilter(QObject* obj, QEvent* e)
{
	if (e->type() == QEvent::Resize) {
		wkeResize(webView, this->width(), this->height());
	}
	return QWidget::eventFilter(obj, e);
}
